from . import log
from .errors import CheckError
import os


def check() -> bool:
    result = True
    cmds = ['virt-install --version', 'bash --version', 'virsh --version']
    for c in cmds:
        r = os.system(f'{c} 2>&1 >/dev/null')
        if r != 0:
            log.error(f'Check command failed: "{c}"')
            result = False
    log.debug('Check dependent commands successfully')
    return result
